home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / wtj007.zip / GLASS.ZIP / LZEXPAND.PAS next >
Pascal/Delphi Source File  |  1992-07-24  |  4KB  |  81 lines

  1. { This is the trial interface for LZEXPAND.DLL, based on my
  2. observations of the Windows 3.0 programs that called LZEXPAND. }
  3.  
  4.  
  5.  unit LZExpand;
  6.  
  7.  interface
  8.  
  9.  uses WinTypes;
  10.  
  11.  function  LZCOPY (SourceHandle, 
  12.                    DestHandle : Integer) : Longint;
  13.    { LZCOPY takes the handle of a source file (opened with LZOPENFILE) and
  14.      the handle of a destination file (opened via the OpenFile API). It
  15.      expands the source file (if it's compressed) as it copies it to the
  16.      destination. The result is positive and gives the number of bytes
  17.      copied if the call succeeds; otherwise, it's negative. }
  18.  function  LZOPENFILE (FileName : PChar;
  19.                        var ReOpenBuff : TOFStruct;
  20.                        Style : Word) : Integer;
  21.    { LZOPENFILE is analogous to the Windows API function OpenFile, and acts
  22.      identically if the file being opened is not compressed. If the file
  23.      being opened is compressed, however, calls to LZREAD and LZSEEK
  24.      automatically work on the compressed file. Note that Turbo's PChar
  25.      type is equivalent to LPSTR in C, and a TOFStruct, passed as a var
  26.      parameter, generates a pointer which is the equivalent of an LPOFSTRUCT.
  27.      If the result is positive, it's the handle of the newly-opened file. }  
  28.  function LZINIT (FileHandle : Integer) : Integer;
  29.    { While this procedure is exported, I couldn't find a Windows application
  30.      that called it; it was called by the library itself as needed. It
  31.      appears to accept the handle of an open file and return a new handle
  32.      if the file is compressed. }   
  33. function LZSEEK (FileHandle : Integer;
  34.                    Offset : Longint;
  35.                    Origin : Integer) : Longint;
  36.    { This is LZEXPAND's analogue of the _llseek function. It takes the same
  37.      parameters and returns the same results, except that it works on all files
  38.      accessed via the LZEXPAND library. }   
  39. function  LZREAD (FileHandle : Integer;
  40.                    Buffer : PChar;
  41.                    Bytes : Integer) : Word;
  42.   { This is LZEXPAND's analogue of the _lread function. It takes the same
  43.     parameters and returns the same results, except that it works on all files
  44.     accessed via the LZEXPAND library. }   
  45. function  LZCLOSE (FileHandle : Integer) : Integer;
  46.    { This is LZEXPAND's analogue of the _lclose function. It takes the same
  47.      parameters and returns the same results: 0 if successful, -1 otherwise.
  48.      It must be called when a program is finished acccessing a file via
  49.      library. }
  50.  
  51.  function  LZSTART : Integer;
  52.   { Must be called before copying a file via LZEXPAND. This routine appears
  53.     to return a 1 if successful and a negative number if it's not. }  
  54.  function COPYLZFILE (SourceHandle,
  55.                        DestHandle : Integer) : Longint;
  56.   { Must be called before accessing a file via LZEXPAND. This routine appears
  57.     to return a 1 if successful and a negative number if it's not. }  
  58.  procedure LZDONE;
  59.   { This procedure must be called when a program is finished using the LZEXPAND
  60.     library to copy files. }
  61.  
  62.  function  GETEXPANDEDNAME (FileName, ExpandedName : PChar) : Integer;
  63.    { This procedure gives the name of the uncompressed version of the
  64.      specified file. }
  65.  
  66.  implementation
  67.  { Give the ordinal and the DLL name for each routine. }
  68.  function  LZCOPY; external 'LZEXPAND' index 1;
  69.  function  LZOPENFILE; external 'LZEXPAND' index 2;
  70.  function  LZINIT; external 'LZEXPAND' index 3;
  71.  function  LZSEEK; external 'LZEXPAND' index 4;
  72.  function  LZREAD; external 'LZEXPAND' index 5;
  73.  function  LZCLOSE; external 'LZEXPAND' index 6;
  74.  function  LZSTART; external 'LZEXPAND' index 7;
  75.  function  COPYLZFILE; external 'LZEXPAND' index 8;
  76.  procedure LZDONE; external 'LZEXPAND' index 9;
  77.  function  GETEXPANDEDNAME; external 'LZEXPAND' index 10;
  78.  
  79.  begin
  80.  end.
  81.